package ByteStream;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class ByteStreameDemo6 {
    public static void main(String[]args) throws IOException {
        FileInputStream fos = new FileInputStream("a.txt");
        byte[] butes = new byte[2];
        int len = fos.read(butes);
        System.out.println(len);
        String str = new String(butes,0,len);
        System.out.println(str);

        int len1 = fos.read(butes);
        System.out.println(len1);
        String str1 = new String(butes,0,len1);
        System.out.println(str1);

        int len2 = fos.read(butes);
        System.out.println(len2);
        String str2 = new String(butes,0,len2);
        System.out.println(str2);

//        int len3 = fos.read(butes);
//        System.out.println(len3);
//        String str3 = new String(butes,0,len3);
//        System.out.println(str1);







        fos.close();


    }

}
